import { axios } from '@/utils/request'

const api = {
  // 账号信息
  account: '/cloud/stbz/account',
  getCatList: '/cloud/stbz/get-cat-list',
  getGoodsList: '/cloud/stbz/get-goods-list',
  getGoodsItem: '/cloud/stbz/get-goods-item',
  addCloudGoods: '/cloud/stbz/add-cloud-goods',
  getCashFlow: '/cloud/stbz/get-cash-flow',
  submitOrder: '/cloud/stbz/submit-order',
  checkGoodsImport: '/cloud/stbz/check-goods-import'
}

export default api

export function setAccount (parameter) {
  return axios({
    url: api.account,
    method: 'post',
    data: parameter
  })
}

export function getAccount (parameter) {
  return axios({
    url: api.account,
    method: 'get',
    params: parameter
  })
}

export function getCatList (parameter) {
  return axios({
    url: api.getCatList,
    method: 'get',
    params: parameter
  })
}

export function getGoodsList (parameter) {
  return axios({
    url: api.getGoodsList,
    method: 'get',
    params: parameter
  })
}

export function getGoodsItem (parameter) {
  return axios({
    url: api.getGoodsItem,
    method: 'get',
    params: parameter
  })
}

export function addCloudGoods (parameter) {
  return axios({
    url: api.addCloudGoods,
    method: 'post',
    data: parameter
  })
}

export function getCashFlow (parameter) {
  return axios({
    url: api.getCashFlow,
    method: 'get',
    params: parameter
  })
}

export function submitOrder (parameter) {
  return axios({
    url: api.submitOrder,
    method: 'post',
    data: parameter
  })
}

export function checkGoodsImport (parameter) {
  return axios({
    url: api.checkGoodsImport,
    method: 'post',
    data: parameter
  })
}